-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Update instagram_pic.py #10957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update instagram_pic.py #10957
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Please
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the issues
for more information, see https://pre-commit.ci
web_programming/instagram_pic.py
Outdated
print(f"Image downloaded and saved as {file_name}") | ||
else: | ||
print("Failed to download the image.") | ||
else: | ||
print("Image URL not found in the meta tag.") | ||
else: | ||
print("No meta tag with 'og:image' property found.") | ||
except requests.exceptions.RequestException as e: | ||
print(f"An error occurred during the HTTP request: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CONTRIBUTING.md: Algorithmic functions should not print()
.
web_programming/instagram_pic.py
Outdated
@@ -1,37 +1,68 @@ | |||
from datetime import datetime | |||
from typing import Optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed on Python 3.12
from typing import Optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cclauss tried many times but every time getting this error
Error: web_programming/instagram_pic.py:1:1: I001 Import block is un-sorted or un-formatted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the imports were working fine before, then do not change them.
Click the text I001 to read the rule and how it works.
python3 -m pip install ruff
and then ruff --select=I --fix web_programming/instagram_pic.py
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
* Update instagram_pic.py * Update instagram_pic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update instagram_pic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update instagram_pic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update instagram_pic.py * Update instagram_pic.py * Update instagram_pic.py * Update instagram_pic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update instagram_pic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update instagram_pic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update instagram_pic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fast fail instead of nested ifs and PEP8: Keep try/except blocks small * Update instagram_pic.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
Describe your change:
Checklist: